package com.xunfang.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yellow Doctor
 * @date 2025-11-11
 * @desc https://blog.csdn.net/hekai7217
 *
 *  消费者消费 mq中的队列中的消息
 */
@Component       //把对象添加到ioc容器中
@Slf4j
@RabbitListener(queues = "songshanghu.gk")   //监听器
public class Fanout2QueueListener {

    @RabbitHandler
    public void handler(String msg){
        log.info("消费者2:消费消息:{}",msg);
    }
}
